using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;

public class UI_SkillToopTip : UI_ToolTip
{
    // 序列化字段，私有变量，用于显示技能描述和技能名称的TextMeshProUGUI组件
    [SerializeField] private TextMeshProUGUI skillText;
    [SerializeField] private TextMeshProUGUI skillName;
    [SerializeField] private TextMeshProUGUI skillCost;
    [SerializeField] private float defaultFontSize = 30;

    // 显示技能提示窗口
    public void ShowToolTip(string _skillDescription, string _skillName,int _price)
    {
        // 设置技能描述和技能名称的文本
        skillText.text = _skillDescription;
        skillName.text = _skillName;
        skillCost.text = "Cost: "+ _price.ToString("#,#");

        AdjustPosition();
        AdjustFontSize(skillName);
        // 显示提示窗口
        gameObject.SetActive(true);
    }

    // 隐藏技能提示窗口
    public void HideToolTip()
    {
        skillName.fontSize = defaultFontSize;
        gameObject.SetActive(false);
    }
}